1. Field of the Invention
The present invention relates to an apparatus and a method for programming functions of a display, especially to an apparatus and a method capable of checking a program code to reduce programming time.
2. Description of the Prior Art
Traditionally, programming functions of a display usually utilizes an apparatus shown in FIG. 1. The apparatus 100 for programming functions of a display comprises a memory 110 and a programming device 120. The memory 110 stores a program code used to update the functions of the display. The programming device 120 is coupled to the memory 110 and a memory 130 of the display. Thus, the programming device 120 reads the program code from the memory 110, and then writes the program code into the memory 130 of the display, so as to update the functions of the display.
The memory 130 of the display is typically a flash memory, which is programmed in unit of a page. The data amount of a page has a limited maximum, which is usually 256 bytes. The data amount of each page cannot be larger than this limited maximum. Therefore, the data amount of each page can be set equal to 256 bytes, 128 bytes, 64 bytes, etc. for programming.
FIG. 2 shows a diagram of writing the program code of a memory 210 into a flash memory 220. The memory 210 is divided into a plurality of pages, namely, the pages 212, 214 . . . , and 216. Now assuming that each page has 256 bytes, thus the pages 212, 214 . . . , and 216 have 256 bytes respectively. When the flash memory 220 is being programmed, the reading process starts at an initial position of the memory 210 to read the data amount of one page, namely, to read the page 212, and then the page 212 is written into a register (not shown). Next, the page 212 in the register is written into the flash memory 220, and the written position in the flash memory 220 corresponds to the relative position of the page 212 in the memory 210. The written page 222 starts from an initial position of the flash memory 220, and it occupies a data amount of one page, namely, 256 bytes in this embodiment.
Next, the page 214 is read from the memory 210 and written into the register, and then the page 214 in the register is written into the flash memory 220 to form the page 224. The relative position of the page 224 in the flash memory 220 corresponds to the relative position of the page 214 in the memory 210; that is, in the flash memory 220, the page 224 follows the page 222. By repeating the above procedures, each page of the memory 210 is written into the flash memory 220 in turn until the last page 216 of the memory 210 is read and written into the flash memory 220 to form the page 226.
However, if the flash memory 220 is programmed in this manner, regardless of the content of the page read from the memory 210, this page shall be written into the flash memory 220 completely. Even if the content of the read page is empty, the programming procedures for this empty page shall still be performed in the flash memory 220, which causes a waste of time.